package com.midou.administration.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.midou.administration.bo.CouponBo;
import com.midou.administration.entity.Coupon;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Property;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author MrChen
 * @since 2021-03-24
 */
public interface CouponMapper extends BaseMapper<Coupon> {
    public List<CouponBo> All(@Param("page") Page page, @Param("id") Integer id);

    public int queryAdd(@Param("coupon") CouponBo couponBo);

    /**
     * 查询活动未结束或活动未开的引用
     */
    List<Coupon> queryAllByCpEndTimeList();

    /*根据活动状态查询活动信息*/
    List<Coupon> queryByState(@Param("id") Integer id);

    /*传入集合  批量更新*/
    Integer updList(@Param("list") List<Coupon> list, @Param("id") Integer integer);

    /**
     * 查询用户名下全部优惠卷信息
     */
    List<CouponBo> findDoUseridAll(@Param("userid") int userid);

    Coupon queryName(@Param("neirong")String neirong);

    int updateNum(Integer id);

    List<Coupon> kaishi();

    List<Coupon> weikaishi();
}
